package com.aqie.easy.bitOperation;

/**
 * 268 缺失数字
 * todo
 * 异或满足交换律
 */
public class MissingNumber {
    public int missingNumber(int[] nums) {
        int res = nums.length;
        for (int i = 0; i < nums.length; i++){
            res ^= nums[i];
            res ^= i;
        }
        return res;
    }
}
